/**
 * @file
 * <pre> CPE 357 Spring 2011
 * -------------------
 *
 *  Header to "progrma header"
 *
 *  Last Modified: Fri May 11 09:41:05 PM PDT 2012</pre>
 *  @author Matthew Tondreau
 */

#ifndef _WINDOW_H_
#define _WINDOW_H_

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <curses.h>
#include <cdk/swindow.h>

/** set top window title */
#define TITLE "MyChannel"
/** Sets the # of lines in the top channel */
#define HEIGHT 20
/** # of lines to save off the screen */
#define LOG 100
/** input cursor graphic */
#define PS1 "me: "

typedef struct {
  WINDOW* wb;     /** bottom window */
  WINDOW* wt;     /** top window */
  CDKSWINDOW* sw; /** top window "scolling window" */
  CDKSCREEN* sc;  /** top window screen */
} ChatWindows;

/** setups the GUI */
void SetupWindows( ChatWindows &cw );

/** Activates the window if ch is the approriate char */
int Activate( ChatWindows &cw, int ch );

/* handles user input. returns null if str not "entered" else
 * will return the string */
const char* GetString( ChatWindows &cw, int ch );

/** destroys all windows */
void CloseWindows( ChatWindows &cw );

/** Deletes the character directly before the cursor */
void Backspace(WINDOW* w);

/** refreshs all windows */
void RefreshAll( ChatWindows &cw );

#endif
